<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            margin: 0;padding: 0;
        }
       
        .box{
            width: 410px;
            margin: 0 auto;
            text-align: center;
        }
      
       input{
        width: 300px;
        height: 30px;
        margin: 10px;
       }
      
       input[type='submit']{
        width: 400px;
        background-color: coral;
       }
       input[type='checkbox']{
        width: 20px;
        vertical-align: middle;
       }

    </style>
</head>
<body>
    <div class="box">
        <h1>淘宝登录</h1>
        手机号码：<input type="tel"placeholder="请输入您的手机号" name="" id="">
        登录密码：<input type="password" placeholder="请输入效验码">
        <input type="submit" name="" id=""value='登录'>
        <input type="checkbox">已阅读并同意以下协议淘宝平台服务协议、隐私权政策、法律声明、支付宝及客户端服务协议
    
    <script src="./jquery/jquery-3.2.1.js"></script>
    <script>
        $('input[type="submit"]').on('click',(e)=>{
            e.preventDefault();
            $.ajax({
                method:'post',
                url:'http://localhost:8080/tomPost',
               data:{
                name:$('input[type="tel"]').val(),
                    password:$('input[type="password"]').val() 
               },
               success:(data)=>{
                    console.log(data);
                },
                error:(err)=>{
                    console.log(err);
                }
            })
        })
    </script>
</body>
</html>